package br.ufrj.dcc.comp2.musica.vista;

import java.awt.Component;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import br.ufrj.dcc.comp2.musica.controle.ControleCardLayout;
import br.ufrj.dcc.comp2.musica.listeners.ListenerBotaoVoltar;

public class PainelLabelPadraoInferior extends JPanel {

	private JLabel labelUfrj;
	JLabel labelLogoUfrj;
	JButton botaoVoltar;
	
	ImageIcon imagemLogoUfrj;
	ControleCardLayout cardLayout;
	GridBagConstraints gBagCons;
	ListenerBotaoVoltar ouvinteVoltar;
	
	
	public PainelLabelPadraoInferior (ControleCardLayout cardLayout) {
		
		this.cardLayout = cardLayout;
		labelUfrj = new JLabel("Universidade Federal do Rio de Janeiro");
		imagemLogoUfrj = new ImageIcon("LogoUFRJ.jpg");
		ouvinteVoltar = new ListenerBotaoVoltar(cardLayout);
		
		botaoVoltar = new JButton("Voltar");
		botaoVoltar.addActionListener(ouvinteVoltar);
		labelLogoUfrj = new JLabel(imagemLogoUfrj);
	
		
		labelUfrj.setFont(new Font("arial",1,16));
		gBagCons = new GridBagConstraints();
		
		setLayout(new GridBagLayout());
		
		
		
		adicionar(labelLogoUfrj, 0, 0);
		gBagCons.insets = new Insets(0, 20, 0, 0);
		adicionar(labelUfrj, 1, 0);
		gBagCons.insets = new Insets(0, 210, 0, 0);
		adicionar(botaoVoltar, 2, 0);
		
		
	}
	
	public void adicionar(Component c, int x, int y) {
		
		gBagCons.gridx = x;
		gBagCons.gridy = y;
		
		
		add(c, gBagCons);
	}
	
}
